package com.haut.config;

import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.springframework.context.annotation.Bean;


public class JdbcConfig {
    public HikariConfig config(){
        HikariConfig config = new HikariConfig();
        config.setDriverClassName("org.hsqldb.jdbc.JDBCDriver");
        config.setJdbcUrl("jdbc:hsqldb:hsql://localhost/");
        config.setUsername("sa");
        config.setPassword("");
        config.setMaximumPoolSize(5);
        config.setMinimumIdle(2);
        return config;
    }

    @Bean
    public HikariDataSource dataSource(){
        HikariDataSource ds = new HikariDataSource(config());
        return ds;
    }
}
